<?php
/*
//
//   作者：杰灵 http://www.lj55.net
//   QQ:3169902984
//

*/
require("../../class/connect.php");
require("../../class/db_sql.php");
require("../../class/functions.php");
//require LoadLang("pub/fun.php");
require("../../class/delpath.php");
require("../../class/t_functions.php");
require("../../data/dbcache/class.php");
require("../../data/dbcache/MemberLevel.php");
require("../../member/class/user.php");
require("../../class/qinfofun.php");
$link=db_connect();
$empire=new mysqlquery();
$filetf='file';
if($_FILES[$filetf]['name'])
{
    $filetype=GetFiletype($_FILES[$filetf]['name']);//取得文件类型
    if(CheckSaveTranFiletype($filetype) || (!stristr(',.gif,.jpg,.png,',','.$filetype.',')))
    {
        echo "附件上传有误";
        db_close();
        $empire=null;
        exit();
    }
    $type=1;
    $filetime=time();
    $filesize=(int)$_FILES[$filetf]['size'];
    $classid=(int)$_POST['classid'];
    $filepass=(int)$_POST['filepass'];
    $fileno=$_POST['name'];
    $fileno="[morepic]".addslashes(RepPostStr($fileno));
    $username=$_POST['username'];
    //$username=iconv("UTF-8","GB2312//IGNORE",$username);
    $username=addslashes(RepPostStr($username));
    $tfr=DoTranFile($_FILES[$filetf]['tmp_name'],$_FILES[$filetf]['name'],$_FILES[$filetf]['type'],$_FILES[$filetf]['size'],$classid);
    eInsertFileTable($tfr[filename],$filesize,$tfr[filepath],'[Member]'.$username,$classid,$fileno,$type,$filepass,$filepass,$public_r[fpath],0,0,$public_r['filedeftb']);
	
	ReturnQAddinfoF(2,"MAddInfo","11","1502718342","1","z45658",0);
    echo $tfr[url];
    db_close();
    $empire=null;
    exit();
}
?>